<template>
  <div>
    <a-layout id="components-layout-demo-top-side-2">
      <a-layout-header class="header">
        <div class="logo" />
        <a-menu
          theme="dark"
          mode="horizontal"
          :default-selected-keys="['1']"
          :style="{ lineHeight: '64px' }"
        >
          <a-menu-item key="1">
            <a-icon type="mail" />nav 1
          </a-menu-item>
          <a-menu-item key="2">nav 2</a-menu-item>
          <a-menu-item key="3">nav 3</a-menu-item>
        </a-menu>
      </a-layout-header>
      <a-layout>
        <a-layout-sider width="200" style="background: #fff">
          <a-menu
            mode="inline"
            :default-selected-keys="['1']"
            :default-open-keys="['sub1']"
            :style="{ height: '100%', borderRight: 0 }"
            @click="onClick"
          >
            <a-menu-item key="1">
              <a-icon type="user" />
              <span>One</span>
            </a-menu-item>
            <a-menu-item key="2">
              <a-icon type="video-camera" />
              <span>Tow</span>
            </a-menu-item>
            <a-menu-item key="3">
              <a-icon type="upload" />
              <span>Treen</span>
            </a-menu-item>
          </a-menu>
        </a-layout-sider>
        <a-layout-content
          :style="{ background: '#fff', padding: '24px', margin: 0, minHeight: '280px' ,border:'1px solid black'}"
        >
          <router-view />
        </a-layout-content>
      </a-layout>
    </a-layout>
  </div>
</template>

<script>
export default {
  // data() {
  //   return {
  //     users: [],
  //     columns: [{}],
  //   };
  // },
  mounted() {},
  methods: {
    onClick(object) {
      console.log(object);
      if (object.key === "1") {
        this.$router.push("/");
      } else if (object.key === "2") {
        this.$router.push("/Tow");
      } else {
        this.$router.push("/Treen");
      }
    },
  },
};
</script>

<style scoped>
#components-layout-demo-top-side-2 .logo {
  width: 120px;
  height: 31px;
  background: rgba(255, 255, 255, 0.2);
  margin: 16px 28px 16px 0;
  float: left;
}
</style>
